﻿using CommonEntity.CommonImageEntities;
using CommonEntity.Handlers;
using OpenCvSharp;
using ScienceAppService.Entities;
using Point3d = CommonEntity.CommonImageEntities.Point3d;

namespace ScienceAppService.ModuleInterface;
public interface IMarkDrawService : IAppBaseService
{
    public SegToolsEnum CurrentMarkDrawType { get;}

    public IList<Point3d> UlnaMarkPoints { get;}
    public IList<Point3d> RadiusMarkPoints { get;}
    public IList<Point3d> TfccMarkPoints { get;}

    /// <summary>
    /// 画笔粗细
    /// </summary>
    public int BrushThickness { get; }

    #region event

    /// <summary>
    /// 刷新标注点
    /// </summary>
    public event CommonHandler<IList<Point3d>>? FrushMarksSubMenuEvent;

    /// <summary>
    /// 图像数据刷新
    /// </summary>
    public event CommonHandler<object> FrushCurrentIndexEvent;

    #endregion

    public Mat? SetBrushThickness(int thick);


    public void SetMarkOrDrawType(SegToolsEnum type);

    /// <summary>
    /// 绘制逻辑
    /// </summary>
    /// <param name="p"></param>
    /// <returns></returns>
    public Mat? Draw(double[] p, Mat drawMat, ImageOrientationEnum orientation, bool isClean = false);

    /// <summary>
    /// 标注逻辑
    /// </summary>
    /// <param name="p"></param>
    public Point3d MarkPoint(double[] p);

    /// <summary>
    /// 刷新标记图
    /// </summary>
    public Mat? GetMarkMat(int index, ImageOrientationEnum orientation);

    /// <summary>
    /// 
    /// </summary>
    /// <param name="type"></param>
    /// <returns></returns>
    public IList<Point3d> GetMarkPointsBySegType(SegToolsEnum type);

    /// <summary>
    /// 获取对应展示列表
    /// </summary>
    /// <returns></returns>
    public IList<Point3d>? GetMarkPoints(int num);

    /// <summary>
    /// 菜单栏选中标记点
    /// </summary>
    /// <param name="num"></param>
    /// <returns></returns>
    public Point3d ChooseMarkPoint(int num);

    /// <summary>
    /// 
    /// </summary>
    /// <param name="num"></param>
    /// <returns></returns>
    public Point3d? DeleteMarkPoint();

    /// <summary>
    /// 重新加载病人的时候使用
    /// </summary>
    public void ClearData();

    /// <summary>
    /// 智能分割
    /// </summary>
    /// <returns></returns>
    public Task AiSeg();

    /// <summary>
    /// 保存勾画信息
    /// </summary>
    /// <returns></returns>
    public Task SaveDrawMat();

}
